home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / windows / wdj1096.zip / NELSON.ZIP / BUG1096B.CPP < prev   
C/C++ Source or Header  |  1996-07-30  |  532b  |  25 lines

  1. #include <iostream.h>
  2.  
  3. extern int ext();
  4. int inline ext()
  5. {
  6.     static int i = 0;
  7.     return ++i;
  8. }
  9.  
  10. static int inline stat()
  11. {
  12.     static int i = 0;
  13.     return ++i;
  14. }
  15.  
  16. void b()
  17. {
  18.     cout << "For pass #2, ext() should return 2, "
  19.          << "stat() should return 1\n";
  20.     cout << "From unit b, ext() returns "  << ext()
  21.          << ", stat() returns = "          << stat()  << "\n";
  22.     cout << "Address of ext() is "     << (void *) ext
  23.          << ", address of stat() is "  << (void *) stat << "\n";
  24. }
  25.